Handle DAC conversion when using weight_norm with newer PyTorch versions#36393
Handle DAC conversion when using weight_norm with newer PyTorch versions#36393vasqu merged 4 commits intohuggingface:mainfrom
Conversation
|
cc @kamilakesbi, who made the original conversions (do they still work with the existing conversion scripts?) |
|
Yes, that PR updates several models including modeling_dac.py to use |
vasqu
left a comment
There was a problem hiding this comment.
Sorry for the late review, this is indeed needed! We also discovered this in #39313 and somehow this PR slipped through :/
A bit unhappy that we have to use a deprecated function but it's kinda forced based on the original weights.
|
@bot /style |
|
Style bot fixed some files and pushed the changes. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: dac |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
…ons (huggingface#36393) * Update convert_dac_checkpoint.py * Update convert_dac_checkpoint.py * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anton Vlasjuk <73884904+vasqu@users.noreply.github.com>
What does this PR do?
nn.utils.weight_normhas been moved tonn.utils.parametrizations.weight_norm. As a result, parametrized layers no longer exposeweight_gorweight_v, but onlyweight. This causes an AttributeError when DAC conversion attempts to access weights:This PR moves
apply_weight_normdirectly into the script, explicitly setting to useweight_norm = nn.utils.weight_normto ensure compatibility.